<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function palindRome(str){
            var len = str.length;
            var str1 = "";
            for(var i=len-1; i>=0;i--){
                str1+=str[i];
            }
            console.log(str1 == str)
        }
        palindRome("abcba");//true
        palindRome("abcbac");//false
    </script>
</head>
<body>

</body>
</html>